import React, { useState } from 'react';
import { Keyboard } from 'react-native';

const useInputWithDone = (defaultValue?:any) => {
    const [inputValue, setInputValue] = useState(defaultValue);

    const handleDone = () => {
        // 隐藏键盘
        Keyboard.dismiss();
    };

    return [inputValue, setInputValue, handleDone];
};

export default useInputWithDone;
